package com.caocaog.market.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.handler.ListToStringHandler;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 服务信息
 *
 * @author chechen
 * @date 2021-11-09
 */
@Data
@TableName("mk_serve_basic")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "mk_serve_basic对象", description = "服务信息")
public class Serve implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    private String updateBy;

    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @TableField(update = "%s+1")
    @ApiModelProperty(value = "版本号")
    private Integer lockVersion;

    @Dict(dicCode = "mk_whether")
    @TableLogic
    @ApiModelProperty(value = "是否删除")
    private Integer delFlag;

    @Dict(dictTable = "mk_shop_basic", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "门店id")
    private String shopId;

    @Dict(dictTable = "mk_merchant_basic", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "商家id")
    private String merchantId;
    // 商家手机号
    private transient String merchantMobile;

    @Dict(dictTable = "mk_site_basic", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "分站id")
    private String siteId;

	@Dict(dicCode = "serve_type")
    @ApiModelProperty(value = "服务类型")
    private String serveType;

    @ApiModelProperty(value = "服务名称")
    private String name;

    @Dict(dicCode = "serve_status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "编号")
    private String code;

    @ApiModelProperty(value = "标签")
    private String tagsId;

    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = FieldStrategy.NOT_NULL, typeHandler = ListToStringHandler.class)
    @ApiModelProperty(value = "底部图片")
    private List<String> imagesBottom;
    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = FieldStrategy.NOT_NULL, typeHandler = ListToStringHandler.class)
    @ApiModelProperty(value = "轮播图")
    private List<String> imagesCarousel;

    /*@ApiModelProperty(value = "底部图片")
    private String imagesBottom;
    @ApiModelProperty(value = "轮播图")
    private String imagesCarousel;*/

    @ApiModelProperty(value = "联系人")
    private String person;

    @ApiModelProperty(value = "联系方式")
    private String contact;

    @ApiModelProperty(value = "详情")
    private String detail;

    @ApiModelProperty(hidden = true)
    private transient String shopName;
    @ApiModelProperty(hidden = true)
    private transient String lng;
    @ApiModelProperty(hidden = true)
    private transient String lat;
    @ApiModelProperty(hidden = true)
    private transient double distance;

    /*@ApiModelProperty(hidden = true)
    private transient String imagesBottomString;
    @ApiModelProperty(hidden = true)
    private transient String imagesCarouselString;*/


    @ApiModelProperty(value = "分站名称", hidden = true)
    private transient String siteName;
    @ApiModelProperty(value = "商家名称", hidden = true)
    private transient String merchantName;

}
